The present invention relates to an apparatus for detecting, for example, a position of that part of the surface of a printed circuit board on which a shape change exists, a position of a component such as chip component which is mounted on a surface, or any of damage of a component, misplacement of a component, breaking of wire, etc. (hereinbelow, also termed the "defect of components").
As described in, for example, Japanese Patent Application Laid-open No. 294302/1986, a prior-art inspection machine for misplaced chip components mounted on a printed circuit board has adopted a method wherein the component to be inspected is irradiated by utilizing a plurality of illuminations, an image of good contrast and an image with only a specified object emphasized are input, and the resulting input image is binary-coded, thereby to inspect the misplacement of the component.
There has also been adopted a method wherein, as described in Japanese Patent Application Laid-open No. 135941/1983, an object to be inspected is irradiated by a parallel illumination, and the shadow of the component to be inspected is formed on a board and is input as an image, thereby to determine the external shape and position of the chip component.
Regarding the prior-art techniques mentioned above, the method disclosed in Japanese Patent Application Laid-open No. 294302/1986 does not give consideration to a case where the combination between the color of the component to be inspected and the color of the board affords a poor contrast, e. g., a case where the colors of the two are similar, so that objects applicable for the inspection have been limited.
The apparatus disclosed in Japanese Patent Application Laid-open No. 135941/1983 does not give consideration to components in more complicated shapes, such as a cylindrical component and a component in any other different shape, so that objects applicable for the inspection have been limited similarly to the above.
Further, both the prior-art techniques project light positively. Nevertheless, they do not consider blooming, smear etc. on imaging devices, which are ascribable to attendant reflected light of high brightness from a solder surface or the like and which occur particularly when solid-state imaging devices are used This has led to the problem that the inspection after soldering becomes difficult.
In addition, as disclosed in the official gazette of Japanese Patent Application Laid-open No. 30659/1980, a position detection apparatus has been employed in order to detect the mounted positions of electronic components installed on a printed circuit board
In the prior-art position detecting apparatus, slit light is projected on the printed circuit board in a direction different from the imaging direction of a TV camera, to form a slit line thereon, an image having the slit line as shown at (2a) in FIG. 1 is taken by the TV camera, the slit line is extracted from the image, and the mounted position of the electronic component is detected on the basis of the shape of the extracted slit line.
In such a position detection apparatus, however, the extraction of the slit line is difficult More specifically, (1a) in FIG. 1 is a diagram showing an image obtained in such a way that the printed circuit board is imaged by the TV camera without projecting the slit light thereon, and (1b) and (2b) in FIG. 1 are graphs showing the brightnesses of the images depicted at (1a) and (2a) in FIG. 1, on I-directional lines at J=J.sub.0. As apparent from the graphs, in a case where the slit light has been projected on a part being originally bright, the brightness of the slit line differs little from the brightness of the same place without the projection of the slit light It is therefore difficult to extract the slit line
Still further, as disclosed in the official gazettes of Japanese Patent Applications Laid-open Nos. 76903/1986 and 107105/1986, it has recently been practised that, in the state in which slit light is obliquely projected on an electronic component mounted on a printed circuit board, an image is taken from above the printed circuit board by a television camera, whereupon the position of the electronic component is detected from the shape of a slit line generated by the projection of the slit light.
In the prior-art method of detecting the position of the electronic component by the use of the slit light, a threshold value is set beforehand, and in the presence of a slit line which is distant in excess of the threshold value from the slit line on the surface of the printed circuit board, the corresponding point is judged as a point on the end part of the electronic component, thereby to detect the position of the electronic component.
Meanwhile, usually the position of the electronic component is detected before this electronic component is soldered to the printed-wiring board. Since, however, the electronic component is sometimes misplaced at the soldering step, the position of the electronic component needs to be also detected after the soldering thereof on the printed-wiring board.
Herein, when the electronic component 69 has been soldered with solder portions 80 as illustrated in FIG. 2, image data becomes as shown in FIG. 3a, and the slit line 72 is not broken at the parts or edge points thereof corresponding to the end parts of the electronic component 69. When the position of the electronic component 69 has been detected with the threshold value set at TH1, the position of the edge point is judged to be i.sub.2 as shown in FIG. 3b although the correct position of the edge point is i.sub.1.Therefore, the position of the electronic component 69 cannot be precisely detected. In order to solve this problem, an appropriate threshold value such as TH2 may be set. Since, however, the distance between the slit line 72 on the surface of the printed circuit board and the slit line 72 on the electronic component 69 disperses greatly, depending upon the state of illumination, the kind of the electronic component 69, etc., it is difficult to set the appropriate threshold value.
Moreover, it is sometimes the case that, as illustrated in FIG. 4, the slit line 72 breaks due to the regular reflection of the slit light attributed to the luster of the solder 80, etc. The image data in this case becomes as shown in FIG. 5a. When the position of the electronic component 69 has been detected with the threshold value set at TH1, the position of the edge point is judged to be i.sub.3 as depicted in FIG. 5b. Therefore, the position of the electronic component 69 cannot be precisely detected